package com.admin.commodity.controller;


import com.admin.commodity.pojo.MobileEndProductList;
import com.admin.commodity.service.MobileEndProductListService;
import com.admin.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 商品分类 前端控制器
 * </p>
 *
 * @author 零
 * @since 2022-12-13
 */
@RestController
@RequestMapping("/admin/product")
public class MobileEndProductListController {
    @Autowired
    private MobileEndProductListService productListService;

    /**
     * 页面加载时获取所有 一级商品名
     * @return R
     */
    @GetMapping("list")
    public R getlist(){
        List<MobileEndProductList> list = productListService.list();
        if (list.size()>0){
            return R.ok().data("items",list);
        }
        return R.error();
    }
}

